<template>
  <!-- 表单提交 -->
  <div class="app-container calendar-list-container">
  <el-form
    :model="mainTreeForm"
    status-icon
    ref="mainTreeForm"
    label-width="100px"
    class="demo-ruleForm"
  >
    <el-form-item label="内容" >
      <el-input v-model="mainTreeForm.content" placeholder="请输入内容"></el-input>
    </el-form-item>
    <el-form-item label="号码">
      <el-input v-model="mainTreeForm.phone" placeholder="请输入号码"></el-input>
    </el-form-item>
    <el-form-item>
      <el-button type="primary"  @click="onSubmit">发送</el-button>
    </el-form-item>
  </el-form>
  </div>
</template>

<script>
import * as api from '@/api/manage/message/index';
import { mapGetters } from "vuex";
export default {
  props: {
    serviceId: {
      default: "1"
    }
  },
  data() {
    return {
      mainTreeForm: {
        content: '',
        phone: ''
      },
    };
  },
  created() {
  },
  computed: {
    ...mapGetters(["elements"])
  },
  methods: {
    onSubmit() {
          api.sendMsg(this.mainTreeForm).then(() => {
            this.$notify({
              title: '成功',
              message: '发送成功',
              type: 'success',
              duration: 2000
            });
          });
      }
    },
};
</script>
